package com.honor.games.wg.graphics.actors;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.honor.games.wg.entities.WGUnit;

public class WGUnitActor extends WGActor {

	private WGUnit unit;
	private Texture texture;
	private Texture selectionTexture;

	public WGUnitActor(String name, WGActorType actorType, WGUnit unit, Texture texture, Texture selectionTexture, float positionX,
			float positionY, float sizeX, float sizeY) {
		super(name, actorType);
		this.unit = unit;
		this.setPosition(positionX, positionY);
		this.setSize(sizeX, sizeY);
		this.setZIndex(0);
		this.texture = texture;
		this.selectionTexture = selectionTexture;
	}

	@Override
	public void draw(SpriteBatch batch, float parentAlpha) {
		batch.draw(texture, this.getX(), this.getY());

		if (unit.isSelected()) {
			batch.draw(selectionTexture, this.getX(), this.getY());
		}
	}
}
